using System;
using System.Collections.Generic;
using System.Linq;

namespace gnodotnet.ApplicationServices {
    public class ServiceResult {
        public ServiceResult() {
            Errors = "".InList();
            Notifications = "".InList();
        }
        public IEnumerable<string> Errors { get; set; }
        public IEnumerable<string> Notifications { get; set; }
        public void ProcessMessage(Action<string> action) {
            action(String.Join(Environment.NewLine, (Notifications.Concat(Errors)).ToArray()));
        }
    }
}
